package cn.edu.zafu.bigdata.lb;

import java.io.*;
/**
 * @author LiuBo
 */
public class ReverseThread extends Thread {
    private final PrintWriter out;
    private final BufferedReader in;

    public ReverseThread(PrintWriter out, Reader source) {
        this.out = out;
        this.in = new BufferedReader(source);
    }

    @Override
    public void run() {
        try {
            String line;
            while ((line = in.readLine()) != null) {
                out.println(new StringBuilder(line).reverse());
            }
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}